let express = require('express')
let app = express()
let db = require('./index')
let selectAll = require('./index')
let router = require('./routes/user')
let upload = require('./routes/images')



// 那个网页可以跑
app.all('*', function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    next();
});

app.use('/index',router)
app.use('/upload',upload)


app.get('/user', (req, res) => {
    let sql = 'SELECT  * from users';
    selectAll(sql, res)

})


app.listen('8085', function () {
    console.log('running')
})